Socket
Socket
Sign inDemoInstall

@paralleldrive/cuid2

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paralleldrive/cuid2

Secure, collision-resistant ids optimized for horizontal scaling and performance. Next generation UUIDs.


Version published
Weekly downloads
255K
decreased by-1.48%
Maintainers
2
Weekly downloads
 
Created

What is @paralleldrive/cuid2?

@paralleldrive/cuid2 is an npm package designed to generate collision-resistant unique identifiers (CUIDs). It is a successor to the original CUID package, offering improvements in terms of simplicity, performance, and security. CUIDs are particularly useful in distributed systems where unique identifiers are required without the risk of collision.

What are @paralleldrive/cuid2's main functionalities?

Generate a CUID

This feature allows you to generate a new CUID. The `createId` function is called to produce a unique identifier, which is then logged to the console.

const { createId } = require('@paralleldrive/cuid2');
const id = createId();
console.log(id);

Custom Length CUID

This feature allows you to generate a CUID with a custom length. By passing an options object with a `length` property to the `createId` function, you can specify the desired length of the CUID.

const { createId } = require('@paralleldrive/cuid2');
const id = createId({ length: 32 });
console.log(id);

Custom Alphabet CUID

This feature allows you to generate a CUID using a custom alphabet. By passing an options object with an `alphabet` property to the `createId` function, you can specify the characters to be used in the CUID.

const { createId } = require('@paralleldrive/cuid2');
const id = createId({ alphabet: '0123456789abcdef' });
console.log(id);

Other packages similar to @paralleldrive/cuid2

Keywords

FAQs

Package last updated on 08 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc